<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        body {
            margin: 0;
            padding: 0;

        }

        .top {
            background: red;
            height:100px;
            width: auto;
        }

        .main {
            background: green;
            height: 600px;
            width: 800px;
            margin: 0 auto;

        }

        .foot {
            background: yellow;
            height: 200px;
            width: 800px;
            margin: 0 auto;
        }

    </style>
</head>
<body>
<div class="top"></div>
<div class="main"></div>
<div class="foot"></div>

</body>
</html>